﻿@{
    Layout = "_ConfigurePlugin";
}
@model ConfigurationModel
@using Grand.Framework;
@using Grand.Plugin.Payments.CashOnDelivery.Models;
@await Component.InvokeAsync("StoreScopeConfiguration")
<form asp-controller="PaymentCashOnDelivery" asp-action="Configure" method="post">
    @(await Html.LocalizedEditor<ConfigurationModel, ConfigurationModel.ConfigurationLocalizedModel>("plugin-settings-localized",
    @<div class="form-horizontal">
        <div class="form-body">
            <div class="form-group">
                <div class="col-md-3 col-sm-3 text-right">
                    @Html.OverrideStoreCheckboxFor(model => model.DescriptionText_OverrideForStore, model => model.Locales[item].DescriptionText, Model.ActiveStoreScopeConfiguration)
                    <admin-label asp-for="@Model.Locales[item].DescriptionText" class="control-label" />
                </div>
                <div class="col-md-9 col-sm-9">
                    <admin-textarea asp-for="@Model.Locales[item].DescriptionText"></admin-textarea>
                    <span asp-validation-for="@Model.Locales[item].DescriptionText"></span>
                </div>
            </div>
            <input asp-for="@Model.Locales[item].LanguageId" type="hidden" />
        </div>
    </div>
    ,
    @<div class="form-horizontal">
        <div class="form-body">
            <div class="form-group">
                <div class="col-md-3 col-sm-3 text-right">
                    @Html.OverrideStoreCheckboxFor(model => model.DescriptionText_OverrideForStore, model => model.DescriptionText, Model.ActiveStoreScopeConfiguration)
                    <admin-label asp-for="DescriptionText" class="control-label" />
                </div>
                <div class="col-md-9 col-sm-9">
                    <admin-textarea asp-for="DescriptionText"></admin-textarea>
                    <span asp-validation-for="DescriptionText"></span>
                </div>
            </div>
        </div>
    </div>
    ,
    //localizable settings per store (overrriden store settings) are not supported yet
    true
    ))
    <div class="form-horizontal">
        <div class="form-body">
            <div class="form-group">
                <div class="col-md-3 col-sm-3 text-right">
                    @Html.OverrideStoreCheckboxFor(model => model.AdditionalFee_OverrideForStore, model => model.AdditionalFee, Model.ActiveStoreScopeConfiguration)
                    <admin-label asp-for="AdditionalFee" class="control-label" />
                </div>
                <div class="col-md-9 col-sm-9">
                    <admin-input asp-for="AdditionalFee" />
                    <span asp-validation-for="AdditionalFee"></span>
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-3 col-sm-3 text-right">
                    @Html.OverrideStoreCheckboxFor(model => model.AdditionalFeePercentage_OverrideForStore, model => model.AdditionalFeePercentage, Model.ActiveStoreScopeConfiguration)
                    <admin-label asp-for="AdditionalFeePercentage" class="control-label" />
                </div>
                <div class="col-md-9 col-sm-9">
                    <admin-input asp-for="AdditionalFeePercentage" />
                    <span asp-validation-for="AdditionalFeePercentage"></span>
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-3 col-sm-3 text-right">
                    @Html.OverrideStoreCheckboxFor(model => model.ShippableProductRequired_OverrideForStore, model => model.ShippableProductRequired, Model.ActiveStoreScopeConfiguration)
                    <admin-label asp-for="ShippableProductRequired" class="control-label" />
                </div>
                <div class="col-md-9 col-sm-9">
                    <admin-input asp-for="ShippableProductRequired" />
                    <span asp-validation-for="ShippableProductRequired"></span>
                </div>
            </div>
        </div>
        <div class="form-actions">
            <div class="row">
                <div class="offset-md-3 offset-sm-3 col-md-9 col-sm-9">
                    <input type="submit" name="save" class="btn green" value="@T("Admin.Common.Save")" />
                </div>
            </div>
        </div>
    </div>
</form>